'use strict';

module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    
    const UserInfoSchema = new Schema({
        userid:   { 
            type: Number,
            unique: true 
        },
        username: { type: String },
        password: { type: String },
        phone:    { type: String },
        roll:     { type: String },
        group:    { type: String },
        createTs: { type: Number },
        changeTs: { type: Number }
    });

    return mongoose.model('Users', UserInfoSchema, 'users', { cache: false });
}